FROM python:3.10.2

ENV PYTHONUNBUFFERED 1

RUN mkdir /AutoOperation

WORKDIR /AutoOperation

RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
RUN pip config set install.trusted-host mirrors.aliyun.com

RUN python -m pip install -U pip

RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN sed -i s@/security.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt update -y

RUN apt install libsndfile1 -y
RUN apt install ffmpeg libsm6 libxext6  -y

CMD pip install -r requirements.txt && python manage.py makemigrations && python manage.py migrate && gunicorn -c gunicorn.conf.py AutoOperation.asgi:application
